package org.chen.ctrip.service.ollama;

import lombok.extern.slf4j.Slf4j;
import org.chen.ctrip.rmq.producer.AiProcessingProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
@Slf4j
public class AiProcessingScheduledTask {
    
    @Autowired
    private AiProcessingProducerService aiProcessingProducer;

    @Scheduled(cron = "0 0 4 * * ?") // 每天凌晨4点执行
    public void scheduledBatchProcess() {
        log.info("定时批量发送AI处理消息");
        aiProcessingProducer.batchSendAiProcessingMessages("SCHEDULED");
    }
}